home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…rary 8 (Internal Edition) / Apple R&P Lib Internal v8.0.iso / 5-Fonts & Software / Demo Software / Canvas 3.0 Demo / Canvas 3.0 Tools / Separations / Separations.rsrc / hd11_1013_Graphics header < prev    next >
Text File  |  1990-06-24  |  5KB  |  138 lines

  1. %%BeginProcSet:CanvasDict
  2. /CanvasDict 250 dict def
  3. CanvasDict begin
  4. systemdict/setpacking known{/origpack currentpacking def true setpacking}if
  5. /bdf{bind def}bind def/xdf{exch bind def}bdf/min{2 copy gt{exch}if pop}bdf/edf{exch def}bdf
  6. /max{2 copy lt{exch}if pop}bdf/cvmtx matrix def/currot 0 def/rotmtx matrix def/origmtx matrix def
  7. /cvangle {360 exch sub 90 add 360 mod}bdf
  8. /setrot {/currot edf rotmtx currentmatrix pop 2 copy translate currot rotate neg exch neg exch translate}bdf
  9. /endrot {rotmtx setmatrix}bdf
  10. /patspot {1 add 4 mul cvi exch 1 add 4 mul cvi exch patstr exch get exch 7 exch sub 1 exch bitshift and 0 ne{1}{0}ifelse}bdf
  11. /f /fill load def
  12. /s {1 setlinewidth penh penv scale stroke}bdf
  13. /i systemdict /image get def
  14. /T true def/F false def
  15. /icomp{/ncolors edf
  16. ncolors 1 gt{/proc0 edf
  17. ncolors 3 eq{{proc0 dup /st0 edf
  18. 0 exch
  19. 3 exch
  20. length
  21. dup 3 sub exch 3 div cvi string /st1 edf{dup
  22. 0 exch
  23. dup
  24. 1 exch
  25. 2 add{st0 exch get add}for
  26. 3 div cvi
  27. dup 255 gt{pop 255}if
  28. exch 3 div cvi exch
  29. st1 3 1 roll put}for
  30. st1}}{{proc0 dup /st0 edf
  31. 0 exch
  32. 4 exch
  33. length
  34. dup 4 sub exch 4 div cvi string /st1 edf{dup
  35. 0 exch
  36. dup
  37. 1 exch
  38. 2 add
  39. { st0 exch get add}for
  40. 3 div
  41. exch dup 3 1 roll 3 add st0 exch get add cvi
  42. dup 255 gt{pop 255}if
  43. exch 4 div cvi exch
  44. st1 3 1 roll put}for
  45. st1}}ifelse}if
  46. i}bdf
  47. /ci{/colorimage where
  48. {pop false exch colorimage} %use existing colorimage
  49. {icomp} %approximate with image command
  50. ifelse}bdf
  51. /spat{/patstr edf
  52. /ncolors edf
  53. /s{ matrix currentmatrix
  54. 1 setlinewidth penh penv scale
  55. 25 setflat    %for curves this reduced number of points
  56. strokepath
  57. setmatrix
  58. impat}def
  59. /f{ impat}def}bdf
  60. /impat{
  61. /samplesize 8 ncolors mul def
  62. /cnt 0 def
  63. currot neg rotate
  64. clip
  65. flattenpath
  66. pathbbox
  67. 3 -1 roll
  68. dup /starty edf
  69. sub abs 8 div ceiling 8 mul cvi /height edf
  70. exch dup /startx edf
  71. sub abs samplesize div ceiling samplesize mul cvi /width edf
  72. startx starty translate
  73. width height scale
  74. /st0 width ncolors mul string def
  75. width height 8 [width 0 0 height neg 0 height]
  76. {patstr
  77. cnt 8 mod samplesize mul
  78. samplesize
  79. getinterval
  80. /st1 edf
  81. 0
  82. samplesize
  83. st0 length samplesize sub dup 0 le{pop 1}if
  84. {st0 exch
  85. st1
  86. putinterval}for
  87. /cnt cnt 1 add def
  88. st0}bind
  89. ncolors
  90. dup 1 eq {icomp}{ci}ifelse
  91. newpath}bdf
  92. /cm{/ncolors edf
  93. translate
  94. scale/height edf/width edf/tbitstr width string def
  95. width height 8 [width 0 0 height neg 0 height]
  96. {currentfile tbitstr readhexstring pop}bind
  97. ncolors
  98. dup 3 eq {ci}{icomp}ifelse}bdf
  99. /im{translate
  100. scale/height edf/width edf/tbitstr width 7 add 8 div cvi string def
  101. width height 1 [width 0 0 height neg 0 height]{currentfile tbitstr readhexstring pop}bind
  102. i}bdf
  103. /imk{/invFlag edf translate scale
  104. /height edf
  105. /width edf
  106. /tbitstr width 7 add 8 div cvi string def
  107. width height invFlag [width 0 0 height neg 0 height]{currentfile tbitstr readhexstring pop}bind imagemask}bdf
  108. /BeginEPSF{/MySave save def/dict_count countdictstack def/op_count count 1 sub def userdict begin
  109. /showpage {} def 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin
  110. 10 setmiterlimit [] 0 setdash newpath
  111. /languagelevel where
  112. {pop languagelevel 1 ne{false setstrokeadjust false setoverprint}if}if}bdf
  113. /EndEPSF{count op_count sub {pop}repeat countdictstack dict_count sub {end}repeat MySave restore}bdf
  114. /setpat {1 currenttransfer exec 0 eq{exch pop{1 exch sub}}{pop{}}ifelse systemdict begin settransfer end /patstr edf 9.375 currot neg rotate 1 0 dtransform exch atan 0 1 dtransform exch pop 0 ge{180 add}if currot rotate/patspot load systemdict begin setscreen end}bdf
  115. systemdict/setcmykcolor known not{/setcmykcolor{/black edf 3{black add 1.0 exch sub 0.0 max 1.0 min 3 1 roll}repeat setrgbcolor}bdf}if
  116. /setpcol{/pgray edf systemdict/setcmykcolor known{/pgray 1 pgray sub def 4{0 eq{0}{pgray}ifelse 4 1 roll}repeat setcmykcolor}
  117. {setcmykcolor currentgray 1 ne{pgray}{1}ifelse setgray}ifelse}bdf
  118. /rectpath {/cv_r edf/cv_b edf/cv_l edf/cv_t edf
  119. cv_l cv_t moveto cv_r cv_t lineto cv_r cv_b lineto cv_l cv_b lineto cv_l cv_t lineto closepath}bdf
  120. /setpen {/penh edf/penv edf/penv2 penv 2 div def/penh2 penh 2 div def}bdf
  121. /dostroke{save /MySave edf not pens 1 currentgray ne or {s}if MySave restore}def
  122. /dodashfill{save /MySave edf not fills 1 currentgray ne or {gsave f grestore [] 0 setdash s}if MySave restore}def
  123. /dofill{save /MySave edf not fills 1 currentgray ne or {f}if MySave restore}def
  124. /doline{save /MySave edf not pens 1 currentgray ne or {f}if MySave restore}def
  125. /pmov{penv2 add exch penh2 sub exch moveto}bdf/plin{penv2 add exch penh2 sub exch lineto}bdf
  126. /linpath{/cv_b edf/cv_r edf/cv_t edf/cv_l edf penh2 dup cv_r exch sub/cv_r edf
  127. cv_l exch sub/cv_l edf penv2 dup cv_b add/cv_b edf cv_t add/cv_t edf cv_r cv_l gt
  128. {cv_b cv_t lt{cv_l cv_t moveto penh 0 rlineto cv_r penh add cv_b lineto 0 penv neg rlineto penh neg 0 rlineto
  129. cv_l cv_t penv neg add lineto}{cv_l cv_t moveto cv_r cv_b lineto penh 0 rlineto 0 penv neg rlineto
  130. cv_l penh add cv_t penv neg add lineto penh neg 0 rlineto 0 penv rlineto}ifelse}{cv_b cv_t lt{
  131. cv_l cv_t moveto cv_r cv_b lineto 0 penv neg rlineto penh 0 rlineto cv_l penh add cv_t penv neg add lineto 0 penv rlineto penh neg 0 rlineto}{
  132. cv_l penh add cv_t moveto cv_r penh add cv_b lineto penh neg 0 rlineto 0 penv neg rlineto
  133. cv_l cv_t penv neg add lineto penh 0 rlineto 0 penv rlineto}ifelse}ifelse closepath}bdf
  134. /dopline {/cv_pv edf/cv_ph edf currentpoint cv_ph cv_pv linpath doline newpath cv_ph cv_pv moveto}bdf
  135. /LswUnits{72 75 div dup scale}bdf
  136. /erasefill{gsave 1.0 setgray fill grestore}bdf
  137. /tpmx matrix def
  138.